package com.wavefront.mtl.parser.line;

import com.wavefront.mtl.elements.RGB;
import com.wavefront.obj.parser.LineParser;
import com.wavefront.obj.parser.MtlParser;

public class KdParser extends LineParser {

	RGB diffuseRGB;

	@Override
	public void parse(String[] words) {
		super.parse(words);
		diffuseRGB = new RGB();
		try {
			diffuseRGB.setR(Float.parseFloat(words[1]));
			diffuseRGB.setG(Float.parseFloat(words[2]));
			diffuseRGB.setB(Float.parseFloat(words[3]));
			MtlParser.currentMaterial.setDiffuse(diffuseRGB);
		} catch (Exception e) {
			throw new RuntimeException("KdParser Error");
		}
	}
}
